#include <iostream>

using namespace std;

int main(void)
{
	const int MAX = 999;
	int i;
	int a, b, c;
	int num = 0;

	for(i = 0; i <= MAX; i ++)
	{
		a = i % 10;
		b = ((i - a) % 100) / 10;
		c = ((i - a - b * 10) % 1000) / 100;
		if((a != b) && (a != c) && (b != c))
			num ++;
	}

	cout << "number = " << num << endl;

	return 0;
}
